package demo1;

public class Hero {
    String name;
    int attack;
    int def;
    int mp;
    int hp;

    //无参的构造方法
    public Hero(){

    }

    public Hero(String name1,int at,int df,int h,int m){
        name=name1;
        attack=at;
        def=df;
        hp=h;
        mp=m;
    }
    public void toAttack(){
        System.out.println(name+"英雄打出了"+attack*5+"的伤害");
    }
    public void showInfo(){
        System.out.println(name+"英雄攻击力"+attack+",防御力"+def
                +",生命值"+hp+",魔法值"+mp);
    }
}
